﻿<ItemsControl x:Class="WPFMitsuControls.Book"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:local="clr-namespace:WPFMitsuControls"
	ClipToBounds="False" Loaded="OnLoaded" Width="500" Height="300"
    >
    <ItemsControl.Resources>
        <DataTemplate x:Key="defaultDataTemplate">
            <Grid>
                <ContentControl Content="{Binding .}" />
            </Grid>
        </DataTemplate>
    </ItemsControl.Resources>
    <ItemsControl.Template>
        <ControlTemplate TargetType="{x:Type local:Book}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <local:BookPage Grid.Column="0" x:Name="sheet0" IsTopRightCornerEnabled="false" IsBottomRightCornerEnabled="false"
                                PageTurned="OnLeftPageTurned" />
                <local:BookPage Grid.Column="1" x:Name="sheet1" IsTopLeftCornerEnabled="false" IsBottomLeftCornerEnabled="false"
                                 PageTurned="OnRightPageTurned" />
            </Grid>
        </ControlTemplate>
    </ItemsControl.Template>
    <ItemsControl.RenderTransform>
        <TransformGroup>
            <ScaleTransform x:Name="scale" ScaleX="1" ScaleY="1"  />
            <RotateTransform Angle="0" />
            <TranslateTransform x:Name="translate" X="0" Y="0" />
        </TransformGroup>
    </ItemsControl.RenderTransform>
</ItemsControl>
